package main

import (
	httptransport "github.com/go-kit/kit/transport/http"
	"golang.org/x/net/context"
	"net/http"
	"ruoyi-go/service"
)

func main() {
	ctx := context.Background()

	srv := service.NewService()
	endpoints := service.Endpoints{HashEndpoint: service.MakeHashEndPoint(srv),
		ValidateEndpoint: service.MakeValidateEndPoint(srv)}
	service.NewHTTPServer(ctx, endpoints)

	http.Handle("/hash", httptransport.NewServer(
		service.MakeHashEndPoint(srv),
		service.DecodeHashRequest,
		service.EncodeResponse,
	))

	//http.ListenAndServe(":8080", nil)

	//http.Handle("/", handle)

}
